package com.allwees.support.fileservice.model;

import com.aliyun.oss.model.OSSObjectSummary;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 文件摘要信息
 *
 * @author yangylsky
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FileSummary extends OSSObjectSummary {
    /**
     * 相对路径
     */
    private String relativePath;

    /**
     * 外网访问路径
     */
    private String url;

    public FileSummary() {
        super();
    }

    public FileSummary(OSSObjectSummary ossObjectSummary) {
        this();

        setBucketName(ossObjectSummary.getBucketName());
        setKey(ossObjectSummary.getKey());
        setETag(ossObjectSummary.getETag());
        setSize(ossObjectSummary.getSize());
        setLastModified(ossObjectSummary.getLastModified());
        setOwner(ossObjectSummary.getOwner());
    }
}
